package mapdemo;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class HashMapTheoryDemo {

    public static void main(String[] args) {
        Map map =new HashMap();
        map.put(33,"33");
        map.put(1,"1");
        map.put(12,"12");
        map.put(25,"25");
        map.put(17,"17");
        map.put(9,"9");

        Set<Map.Entry> set = map.entrySet();
        System.out.println("-----------entry遍历-----------");
        for(Map.Entry entry: set){
            System.out.println(entry.getKey() + "=" + entry.getValue());
        }
        System.out.println("---------key set 遍历----------");
        Set keys =  map.keySet();
        for(Object k: keys){
            System.out.println(k + "=" + map.get(k));
        }
    }
}
